let geolocation = new BMap.Geolocation();
		geolocation.getCurrentPosition(function(r){
			if(this.getStatus() == BMAP_STATUS_SUCCESS){
				getWeatherByGeo(r.point.lng, r.point.lat)
			}else{
				alert('failed'+this.getStatus());
			}        
		},{enableHighAccuracy: true})
	
		function getWeatherByGeo(lng, lat){
			$.ajax({
				url: 'https://devapi.qweather.com/v7/weather/7d?',
				type: 'get',
				dataType: 'json',
				data: {
					location: `${lng},${lat}`,
					key: '29e9a3d4d5a24c3a98b0ca51e4523faf'
				},
				success: function(res){
					console.log(res);
					// let html = '';
					// for(let i=0; i < res.daily.length; i++){
					// 	html += `
					// 			<li>
					// 				<div class="specificDate">${res.daily[i].fxDate}</div>
					// 				<i class="icon_weather_day"><img src='images/${res.daily[i].iconDay}.png'></i>
					// 				<div class="weather_day">${res.daily[i].textDay}</div>
					// 				<div class="maxTemperature">${res.daily[i].tempMax}°</div>
					// 				<div class="minTemperature">${res.daily[i].tempMin}°</div>
					// 				<i class="icon_weather_night"><img src='images/${res.daily[i].iconNight}.png'></i>
					// 				<div class="weather_night">${res.daily[i].textNight}</div>
					// 				<div class="windSpeed">${res.daily[i].windScaleDay}级</div>
					// 			</li>
					// 			`
					// }
					// $('.list').append(html);
					$('ul li:nth-child(1) .specificDate').html(res.daily[0].fxDate);
					$('ul li:nth-child(1) .icon_weather_day').css('background','url(images/' + res.daily[0].iconDay + '.png');
					$('ul li:nth-child(1) .icon_weather_day').css('background-size','100% 100%');
					$('ul li:nth-child(1) .weather_day').html(res.daily[0].textDay);
					$('ul li:nth-child(1) .maxTemperature').html(res.daily[0].tempMax+'°');
					$('ul li:nth-child(1) .minTemperature').html(res.daily[0].tempMin+'°');
					$('ul li:nth-child(1) .icon_weather_night').css('background','url(images/' + res.daily[0].iconNight + '.png');
					$('ul li:nth-child(1) .icon_weather_night').css('background-size','100% 100%');
					$('ul li:nth-child(1) .weather_night').html(res.daily[0].textNight);
					$('ul li:nth-child(1) .windSpeed').html(res.daily[0].windScaleDay+'级');
					
					$('ul li:nth-child(2) .specificDate').html(res.daily[1].fxDate);
					$('ul li:nth-child(2) .icon_weather_day').css('background','url(images/' + res.daily[1].iconDay + '.png');
					$('ul li:nth-child(2) .icon_weather_day').css('background-size','100% 100%');
					$('ul li:nth-child(2) .weather_day').html(res.daily[1].textDay);
					$('ul li:nth-child(2) .maxTemperature').html(res.daily[1].tempMax+'°');
					$('ul li:nth-child(2) .minTemperature').html(res.daily[1].tempMin+'°');
					$('ul li:nth-child(2) .icon_weather_night').css('background','url(images/' + res.daily[1].iconNight + '.png');
					$('ul li:nth-child(2) .icon_weather_night').css('background-size','100% 100%');
					$('ul li:nth-child(2) .weather_night').html(res.daily[1].textNight);
					$('ul li:nth-child(2) .windSpeed').html(res.daily[1].windScaleDay+'级');
					
					$('ul li:nth-child(3) .specificDate').html(res.daily[2].fxDate);
					$('ul li:nth-child(3) .icon_weather_day').css('background','url(images/' + res.daily[2].iconDay + '.png');
					$('ul li:nth-child(3) .icon_weather_day').css('background-size','100% 100%');
					$('ul li:nth-child(3) .weather_day').html(res.daily[2].textDay);
					$('ul li:nth-child(3) .maxTemperature').html(res.daily[2].tempMax+'°');
					$('ul li:nth-child(3) .minTemperature').html(res.daily[2].tempMin+'°');
					$('ul li:nth-child(3) .icon_weather_night').css('background','url(images/' + res.daily[2].iconNight + '.png');
					$('ul li:nth-child(3) .icon_weather_night').css('background-size','100% 100%');
					$('ul li:nth-child(3) .weather_night').html(res.daily[2].textNight);
					$('ul li:nth-child(3) .windSpeed').html(res.daily[2].windScaleDay+'级');
					
					$('ul li:nth-child(4) .specificDate').html(res.daily[3].fxDate);
					$('ul li:nth-child(4) .icon_weather_day').css('background','url(images/' + res.daily[3].iconDay + '.png');
					$('ul li:nth-child(4) .icon_weather_day').css('background-size','100% 100%');
					$('ul li:nth-child(4) .weather_day').html(res.daily[3].textDay);
					$('ul li:nth-child(4) .maxTemperature').html(res.daily[3].tempMax+'°');
					$('ul li:nth-child(4) .minTemperature').html(res.daily[3].tempMin+'°');
					$('ul li:nth-child(4) .icon_weather_night').css('background','url(images/' + res.daily[3].iconNight + '.png');
					$('ul li:nth-child(4) .icon_weather_night').css('background-size','100% 100%');
					$('ul li:nth-child(4) .weather_night').html(res.daily[3].textNight);
					$('ul li:nth-child(4) .windSpeed').html(res.daily[3].windScaleDay+'级');
					
					$('ul li:nth-child(5) .specificDate').html(res.daily[4].fxDate);
					$('ul li:nth-child(5) .icon_weather_day').css('background','url(images/' + res.daily[4].iconDay + '.png');
					$('ul li:nth-child(5) .icon_weather_day').css('background-size','100% 100%');
					$('ul li:nth-child(5) .weather_day').html(res.daily[4].textDay);
					$('ul li:nth-child(5) .maxTemperature').html(res.daily[4].tempMax+'°');
					$('ul li:nth-child(5) .minTemperature').html(res.daily[4].tempMin+'°');
					$('ul li:nth-child(5) .icon_weather_night').css('background','url(images/' + res.daily[4].iconNight + '.png');
					$('ul li:nth-child(5) .icon_weather_night').css('background-size','100% 100%');
					$('ul li:nth-child(5) .weather_night').html(res.daily[4].textNight);
					$('ul li:nth-child(5) .windSpeed').html(res.daily[4].windScaleDay+'级');
				}
			})
		}
function formatTime(){
	var date = new Date();
	var date = date.getDay();
	return '今天';
}
$('ul li:nth-child(1) .date').html(formatTime());

function formatTime2(){
	var date = new Date();
	var date = date.getDay() + 1;
	return '明天';
}
$('ul li:nth-child(2) .date').html(formatTime2());

function formatTime3(){
	var date = new Date();
	var date = date.getDay() + 2;
	switch(date){
		case 0: 
			return '星期日';
			break;
		case 1:
			return '星期一';
			break;
		case 2:
			return '星期二';
			break;
		case 3:
			return '星期三';
			break;
		case 4:
			return '星期四';
			break;
		case 5:
			return '星期五';
			break;
		case 6:
			return '星期六';
			break;
	}
}
$('ul li:nth-child(3) .date').html(formatTime3());

function formatTime4(){
	var date = new Date();
	var date = date.getDay() + 3;
	switch(date){
		case 0: 
			return '星期日';
			break;
		case 1:
			return '星期一';
			break;
		case 2:
			return '星期二';
			break;
		case 3:
			return '星期三';
			break;
		case 4:
			return '星期四';
			break;
		case 5:
			return '星期五';
			break;
		case 6:
			return '星期六';
			break;
	}
}
$('ul li:nth-child(4) .date').html(formatTime4());

function formatTime5(){
	var date = new Date();
	var date = date.getDay() + 4;
	if(date >= 7){
		date = 0;
	}
	switch(date){
		case 0: 
			return '星期日';
			break;
		case 1:
			return '星期一';
			break;
		case 2:
			return '星期二';
			break;
		case 3:
			return '星期三';
			break;
		case 4:
			return '星期四';
			break;
		case 5:
			return '星期五';
			break;
		case 6:
			return '星期六';
			break;
	}
}
$('ul li:nth-child(5) .date').html(formatTime5());
